Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

369
Views
SyntaxError: Unexpected token, expected "," -- React w Typescript (.tsx)

I know several variations of this question have been asked. But, I haven't been able to find a solution for this particular case. Apologies in advance if I've overlooked something.

I'm getting the following error:

Unexpected token, expected "," (25:25)

function render( basename:string ) {
                         ^

Here's the function that is being pointed to in index.tsx:

function render( basename:string ) {
  ReactDOM.render(
    <StrictMode>
      <Router basename={basename}>
        ...
      </Router>
    </StrictMode>,
    document.getElementById(target),
  );
};

One thing to note, the red error line doesn't show up in the code. It just breaks with the above error when trying to serve my UI container. I'm using webpack to serve using a few plugins in my webpack.config.js. I have typescript installed. I'm wondering if this is a linter error?

Here's the local tsconfig.json

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "target": "es2020",
    "jsx": "react-jsx",
    "types": ["jest", "cypress", "@testing-library/cypress", "@testing-library/jest-dom"]
  },
  "include": ["src", "test", "webpack.config.js", "jest.config.js", "babel.config.js"]
}

... which extends

{
  "compilerOptions": {
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": false,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true
  }

edit: .eslintrc.json

{
  "env": {
    "node": true,
    "cypress/globals": true
  },
  "extends": ["plugin:cypress/recommended"],
  "plugins": ["cypress"]
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!